import Api from '@/api/system/power'
import i18n from "@/lang/index";
const modalConfig = {
  pageName: "sys:user",
  dialog: {
    title: i18n.global.t("title.9"),
    width: 800,
    appendToBody: true,
    draggable: true,
    labelWidth: "auto",
  },
  formAction: (data) => {
    console.log("add", data);
    return new Promise((resolve, reject) => {
      Api.add(data).then(s => {
        console.log(s);
        resolve(s)
      }).catch(e => {
        reject(e)
      })
    });
  },
  formItems: [
    {
      type: "input",
      label: i18n.global.t("form.35"),
      prop: "name",
      attrs: {
        placeholder: i18n.global.t("hint.60"),
      },
    },
    {
      type: "input",
      label: i18n.global.t("label.80"),
      prop: "title",
      attrs: {
        placeholder: i18n.global.t("hint.82"),
      },
    },
    {
      type: "input",
      label: i18n.global.t("label.81"),
      prop: "description",
      attrs: {
        placeholder: i18n.global.t("hint.83"),
      },
    },
  ],
  formRules: {
    name: [{ required: true, message: i18n.global.t("hint.60"), trigger: "blur" }],
    title: [{ required: true, message: i18n.global.t("hint.82"), trigger: "blur" }],
  },
};

export default modalConfig;
